var cFrontPanel = Class.create();
cFrontPanel.parentNode = "";
cFrontPanel.prototype = 
{
	initialize : function(parentnode,cid)
	{
		// alert(parentnode);
		this.parentNode = parentnode;
		this.cid = cid;
		this.fetchPanel(cid);
	},
	data:"",
	cid:"",
	req:"",

	fetchPanel : function(cid)
	{
		this.req = new Ajax.Request('category_block.aspx', 
									{
									method:'post', 
									asynchronous: 'true',
									parameters:'cid='+cid, 
									onComplete:this.finishFunc.bind(this)
									});
	},
	finishFunc : function()
	{
		//alert(FrontPanel.req.transport.responseText);
		var content = document.createElement('div');
		content.id = "content"+this.cid;	
		this.parentNode.appendChild(content);
		content.className = "content";
		content.innerHTML = this.req.transport.responseText;
		new Draggable("content"+this.cid, {revert:true});
	}
}

var rFrontPanel = Class.create();
rFrontPanel.parentNode = "";
rFrontPanel.prototype = 
{
	initialize : function(parentnode,rid)
	{
		// alert(parentnode);
		this.parentNode = parentnode;
		this.rid = rid;
		this.fetchPanel(rid);
	},
	data:"",
	rid:"",
	req:"",

	fetchPanel : function(rid)
	{
		this.req = new Ajax.Request('region_block.aspx', 
									{
									method:'post', 
									asynchronous: 'true',
									parameters:'rid='+rid, 
									onComplete:this.finishFunc.bind(this)
									});
	},
	finishFunc : function()
	{
		//alert(FrontPanel.req.transport.responseText);
		var content = document.createElement('div');
		content.id = "content"+this.rid;	
		this.parentNode.appendChild(content);
		content.className = "content";
		content.innerHTML = this.req.transport.responseText;
		new Draggable("content"+this.rid, {revert:true});
	}
}